<%@ page language="java" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<HTML>
<HEAD>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <%--	<link href="${pageContext.request.contextPath}/admin/css/Style.css" rel="stylesheet" type="text/css" />--%>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/admin/css/bootstrap.min.css">
<%--    <script language="javascript" src="${pageContext.request.contextPath}/admin/js/public.js"></script>--%>
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        //删除订单
        function o_del() {
            var msg = "您确定要删除该订单吗？";
            if (confirm(msg) == true) {
                return true;
            } else {
                return false;
            }
        }
    </script>

</HEAD>
<body>
<form id="Form1" name="Form1" class="form-inline" action="${pageContext.request.contextPath}/findOrderByManyCondition"
      method="post">
    <table cellSpacing="1" cellPadding="0" width="100%" align="center" border="0">
        <TBODY>
        <tr>
            <td align="center" bgColor="#afd1f3">
                <h4><strong>查 询 条 件</strong></h4>
            </td>
        </tr>
        <tr>
            <td style=" padding:20px 0;">
                <table cellpadding="0" cellspacing="0" border="0" width="100%" >
                    <tr >
                        <td height="30" align="center">
                            订单编号：<input type="text" class="form-control" placeholder="" name="id"></td>
                        <%--								<td>--%>

                        <%--									<input type="text" name="id" size="15" value="" id="Form1_userName" class="bg" />--%>
                        <%--								</td>--%>
                        <td height="22" align="center">
                            收件人：<input type="text" class="form-control" placeholder="" name="receiverName"></td>
                        <%--                        <td width="100" height="22" align="center" class="ta_01"></td>--%>
                        <%--                        <td class="ta_01">--%>
                        <%--                            <font face="宋体" color="red"> &nbsp;</font>--%>
                        <%--                        </td>--%>
                        <%--                        <td align="right" class="ta_01">--%>
                        <%--                            <br/><br/>--%>
                        <%--                        </td>--%>
                        <%--                        <td align="right" class="ta_01">--%>
                        <td>
                            <button type="submit" id="search" name="search" value="&#26597;&#35810;"
                            class="btn btn-primary">
                                &#26597;&#35810;
                            </button> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="reset" name="reset" value="&#37325;&#32622;" class="btn btn-danger"/></td>
                        <%--                        </td>--%>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center" bgColor="#afd1f3">
                <h4><strong>订 单 列 表</strong></h4>
            </td>
        </tr>
        <tr>
            <td class="ta_01" align="right"></td>
        </tr>
        <tr>
            <td class="ta_01" align="center">
                <table
                        id="DataGrid1"
                        class="table-hover table-striped table"
                >
                    <%--							style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">--%>
                    <tr bgColor="#afd1f3">
                        <th style="text-align: center" width="20%">订单编号</th>
                        <th style="text-align: center"  width="10%">收件人</th>
                        <th style="text-align: center"  width="15%">地址</th>
                        <th style="text-align: center"  width="10%">联系电话</th>
                        <th width="11%" style="text-align: center" >总价</th>
                        <th width="8%" style="text-align: center" >所属用户</th>
                        <th width="10%" style="text-align: center" >订单状态</th>
                        <th width="7%" style="text-align: center" >查看</th>
                        <th width="7%" style="text-align: center" >删除</th>
                    </tr>
                    <c:forEach items="${orders}" var="order">
                        <tr align="center">
                            <td>${order.id}</td>
                            <td>${order.receiverName}</td>
                            <td>${order.receiverAddress }</td>
                            <td>${order.receiverPhone }</td>
                            <td>${order.money}</td>
                            <td>${order.user.username}</td>
                            <td>${order.paystate==0?"未支付":"已支付"}</td>
                            <td>
                                <a href="${pageContext.request.contextPath}/findOrderById?id=${order.id}&type=admin" class="btn btn-primary" style="color: white">
<%--                                    <img src="${pageContext.request.contextPath}/admin/images/button_view.gif"--%>
<%--                                         border="0">--%>编辑
                                </a>
                            </td>
                            <td>
                                <!--  已支付，弹出提示框由操作人确认 -->
                                <c:if test="${order.paystate!=0 }">
                                    <a href="${pageContext.request.contextPath}/delOrderById?id=${order.id}&type=admin"
                                       onclick="javascript:return o_del()" class="btn btn-danger" >
                                        <%--<img src="${pageContext.request.contextPath}/admin/images/i_del.gif" width="16"
                                             height="16" border="0">--%>删除
                                    </a>
                                </c:if>
                                <!--  未支付 ，不能删除-->
                                <c:if test="${order.paystate==0 }">
                                    <a href="javascript:alert('不能删除未支付订单')" class="btn btn-danger">
<%--                                        <img src="${pageContext.request.contextPath}/admin/images/i_del.gif" width="16"--%>
<%--                                             height="16" border="0">--%>删除
                                    </a>
                                </c:if>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
            </td>
        </tr>
        </TBODY>
    </table>
</form>
</body>
</HTML>
